package com.aizhixin.lab.task.repository;

import com.aizhixin.lab.common.core.DataValidity;
import com.aizhixin.lab.task.entity.TaskStuAnswer;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;


public interface TaskStuAnswerRepository extends JpaRepository<TaskStuAnswer, String> {
	void deleteByTaskStuInforIdAndDeleteFlag(String taskStuInforId,Integer deleteFlag);
	List<TaskStuAnswer> findAllByTaskStuInforIdAndReleaseTaskIdAndDeleteFlag(String taskStuInforId,String releaseTaskId,Integer deleteFlag);
	List<TaskStuAnswer> findByIdInAndDeleteFlag(List<String> ids, Integer deleteFlag);
	TaskStuAnswer findByIdAndDeleteFlag(String id,Integer deleteFlag);
	TaskStuAnswer findByReleaseQuestionIdAndStuId(String releaseTaskId,Long stuId);
	TaskStuAnswer findByReleaseQuestionIdAndTaskStuInforId(String releaseQuestionId,String taskStuInforId);
	Integer countByReleaseTaskIdAndStuId(String releaseTaskId,Long stuId);
	Integer countByReleaseTaskIdAndStuIdAndIsCorrect(String releaseTaskId,Long stuId,Integer isCorrect);
	Integer countByReleaseQuestionIdAndIsCorrectAndReleaseTaskIdAndDeleteFlag(String releaseQuestionId,Integer isCorrect,String releaseTaskId,Integer deleteFlag);
	Integer countByReleaseQuestionIdAndReleaseTaskIdAndDeleteFlag(String releaseQuestionId,String releaseTaskId,Integer deleteFlag);
	Integer countByTaskStuInforIdAndDeleteFlagAndStuAnswerNotIn(String taskStuInforId,Integer isCorrect,List<String> stuAnswers);
}
